package com.weds.data_sync.config;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author lihw
 * @Date 2024/1/16 8:54
 */
@Slf4j
@Component
public class TestJob {

    public void init() {
        log.info("init--------");
    }

    public void destroy() {
        log.info("destroy------");
    }

    @XxlJob(init = "init", value = "demoHandler", destroy = "destroy")
    public void demoHandler() {
        XxlJobHelper.log(">>>>>>>>>>>>>>>开始执行 demoHandler ");
        log.info("demoHandler execute");
        XxlJobHelper.log(">>>>>>>>>>>>>>>结束执行 demoHandler ");

        XxlJobHelper.handleSuccess("demoHandler 执行成功");
    }
}
